-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mediatek: filogic: wax220: support factory image #13015
Conversation
000bc52
to
912522f
Compare
/cc @Flole998 |
912522f
to
2c0b0d8
Compare
Why the u-boot envtools config change? |
The order of the MTD partitions changed, which changes the mtd number. |
Is the u-boot environment partition change also needed when you install it like it was done without your patch? Is it broken in general for this device or is this related to your changes? |
Whoops this change got squashed into the wrong commit. I'll fit it, thanks for bringing this up. |
8e75455
to
dcb64c2
Compare
9d2cc50
to
8d901b2
Compare
Tested on a WAX220 with FW 1.0.3.0: Update to OpenWrt using the factory image works. The initramfs doesn't seem to require special padding, so dropping the board specific build script. |
While OpenWrt starts successfully, I realized that the if [ "y" = "n" ]; then
# create rootfs_data for non-ubifs rootfs
if [ "$rootfs_type" != "ubifs" ]; then
if ! ubimkvol /dev/$ubidev -N rootfs_data -m; then
echo "cannot initialize rootfs_data volume"
return 1
fi
fi
fi
Not sure how to fix this, maybe a custom boot script can be added to create a |
8d901b2
to
3a7f9d1
Compare
I've added |
3a7f9d1
to
a6ab740
Compare
This code will also run if openwrt is started as initramfs, right? That's not a good idea, the initramfs should leave the onboard flash memory untouched unless the user explicitly modifies it (by using sysupgrade command for example). |
As per my testing, it appears not. But I don't know why 🙈 . The script is there ( To be sure, we could add this: [ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main rootfs_prepare |
a6ab740
to
1263562
Compare
I'd suggest figuring out why it's not running on an initramfs to avoid adding unnecessary code. |
Yeah, I am trying, but so far didn't made any progress. A early "echo" in |
Ok, I think I understand now: |
Yes, it seems to be designed exactly for this. Although this is more difficult to understand, it seems like it's exactly what's wanted in this case. |
1263562
to
a82ac65
Compare
I've removed the Thanks for the review! 🙏 |
Enable building a factory image which can be flashed through the OEM firmware's web interface. It seems that the web interface requires a minimum file size of 10MiB, otherwise it will not accept the image. The update image is a regular sysupgrade tarball packed in a Netgear encrypted image. The Netgear encrypted image is the same as used in WAX202 or WAX206, including the encryption keys and IV. This adds a script which creates the rootfs_data volume on first startup. This is required since the OEM firmware's sysupgrade scripts do not create such a paritition. Note that any script ordered after 70_initramfs_test will not get executed on initramfs. Hence this new script 75_rootfs_prepare won't create the rootfs_data volume when using the recovery initramfs. Also, this deletes the kernel_backup and rootfs_backup volumes in case we have to create the rootfs_data volumes. This makes sure that OpenWrt is the actual backup firmware instead of the stock firmware. References in WAX220 GPL source: https://www.downloads.netgear.com/files/GPL/WAX220-V1.0.2.8-gpl-src.tar.gz * package/base-files/files/lib/upgrade/nand.sh:186 Creation of rootfs_data is disabled * Uboot-upstream/board/mediatek/common/ubi_helper.c Automatic creation of UBI backup volumes Signed-off-by: Stefan Agner <stefan@agner.ch>
a82ac65
to
f77260e
Compare
I've also tested this also with I've added initial documentation for this platform, see https://openwrt.org/toh/netgear/wax220. @dangowrt, since you reviewed/merged the initial WAX220 support: Could you maybe have a look if this looks fine to you? There is also the cleanup PR #13017. |
Merged to my staging tree - thanks! |
@blocktrron thanks for merging! Do you have an estimate when this commit will appear on main (and therefor make it into snapshot releases?) |
Done. |
Enable building a factory image which can be flashed through the OEM
firmware's web interface. It seems that the web interface requires a
minimum file size of 10MiB, otherwise it will not accept the image.
The update image is a regular sysupgrade tarball packed in a Netgear
encrypted image. The Netgear encrypted image is the same as used in
WAX202 or WAX206, including the encryption keys and IV.